package com.yy.manager
{
	/**
	 *UI控制器 
	 * @author YY
	 * 
	 */
	public class UiManager
	{
		//提示控制器
		private static var _toolTip:* = ToolTipManager;
		//弹框控制器
		private static var _popUp:* = PopUpManager;
		//接受鼠标层控制器
//		private static var _mouse:* = MouseManager;
		//拖动控制器
		private static var _drag:* = DragManager;
		//悬浮层控制器
		private static var _floatingPanelManager:* = FloatingPanelManager;
		//语言控制器
		private static var _languageManager:* = LanguageManager;
		//声音控制器
		private static var _soundManager:* = SoundManager;
		//全屏控制器
		private static var _fullScreenPanelManager:* = FullScreenPanelManager;
		public function UiManager()
		{
		}
		public static function registerToolTipManager(cls:Class):void{
			_toolTip = cls;
		}
		public static function getToolTipManager():ToolTipManager{
			_toolTip = getInstance(_toolTip);
			return (_toolTip);
		}
		public static function registerPopUpManager(cls:Class):void{
			_popUp = cls;
		}
		public static function getPopUpManager():PopUpManager{
			_popUp = getInstance(_popUp);
			return (_popUp);
		}
//		public static function registerMouseManager(cls:Class):void{
//			_mouse = cls;
//		}
//		public static function getMouseManager():MouseManager{
//			_mouse = getInstance(_mouse);
//			return (_mouse);
//		}
		public static function registerDragManager(cls:Class):void{
			_drag = cls;
		}
		public static function getDragManager():DragManager{
			_drag = getInstance(_drag);
			return (_drag);
		}
		public static function registerFloatingPanelManager(cls:Class):void{
			_floatingPanelManager = cls;
		}
		public static function getFloatingPanelManager():FloatingPanelManager{
			_floatingPanelManager = getInstance(_floatingPanelManager);
			return (_floatingPanelManager);
		}
		public static function registerLanguageManager(cls:Class):void{
			_languageManager = cls;
		}
		public static function getLanguageManager():LanguageManager{
			_languageManager = getInstance(_languageManager);
			return (_languageManager);
		}
		public static function registerSoundManager(cls:Class):void{
			_soundManager = cls;
		}
		public static function getSoundManager():SoundManager{
			_soundManager = getInstance(_soundManager);
			return (_soundManager);
		}
		public static function registerFullScreenPanelManager(cls:Class):void{
			_fullScreenPanelManager = cls;
		}
		public static function getFullScreenPanelManager():FullScreenPanelManager{
			_fullScreenPanelManager = getInstance(_fullScreenPanelManager);
			return (_fullScreenPanelManager);
		}
		private static function getInstance(cls:Object):Object{
			if (cls == null){
				return (null);
			};
			if ((cls is Class)){
				return new cls();
			};
			return (cls);
		}
	}
}